package com.qk.manangement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qk.entity.pojo.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Entity com.qk.entity.pojo.Course
 */
public interface CourseMapper extends BaseMapper<Course> {

    /**
     * 获取所有课程信息
     * @return
     */
    List<Course> list(String name, Integer subject, Integer target);

    /**
     * 删除课程信息
     * @param id
     * @return
     */
    @Delete("delete from course where id = #{id}")
    int deleteById(Integer id);

    /**
     * 添加课程信息
     * @param course
     * @return
     */
    int insert(Course course);

    /**
     * 根据id查询课程信息
     * @param id
     * @return
     */
    @Select("select * from course where id = #{id}")
    Course getById(Integer id);


    /**
     * 根据id更新课程信息
     * @param course
     * @return
     */
    int updateById(Course course);
}




